<template>
  <div>
    <ve-histogram :data="chartData" :after-config="afterConfig"></ve-histogram>
  </div>
</template>

<script>
import $api from "@/api/api-charts";
import DateTime from "@/utils/DateTime";

export default {
  name: "HisCinemaOrder",
  data: function () {
    return {
      chartData: {
        columns: ['影院', '交易金额'],
        rows: []
      },
      params: {
        tenantName: '',
        cinemaName: '',
        channelTypeName: '',
        channelName: '',
        orderYear: '',
        orderMonth: '',
        orderDay: '',
        orderHour: '',
        datetimeStart: DateTime.of().toDateTimeStart(),
        datetimeEnd: DateTime.of().toDateTimeEnd()
      }
    }
  },
  created() {
    $api.chartsCinemaOrder(this.params).then(data => this.chartData = data);
  },
  methods: {
    afterConfig(options) {
      if (options && options.xAxis && options.xAxis[0]) {
        options.xAxis[0].axisLabel = {
          interval: 0,
          rotate: 60
        };
      }
      return options;
    }
  }
}
</script>

<style scoped>

</style>
